<?php
	include(ROOTPATH .'include'. DS .'protect.php');
	include ROOTPATH .'include'. DS .'isMyQuery.php';
	include(ROOTPATH .'include'. DS .'checkUserLogin.php');
	$powder_min = 9 ;
	include(ROOTPATH .'include'. DS .'checkPowder.php');
	
	$fileName			= getQuery('fileName');
	$files 				= getQuery('file');
	$link 				= getQuery('link');
	
	if( $files == '' )
		exit( '{"status":"error","msg":"你没有选择作品.请选择作品."}');
//	if( $fileName == '' )
//		exit( '{"status":"error","msg":"请填写作品名称."}');
	
	// 移动	
	$files = explode('|',$files);
	$filesList = moveUploadFile($files, INDEX_COMMEND_PATH );	
 
	$array['name'] 			= $fileName ;
	$array['thumb'] 		= $filesList ;
	$array['link'] 			= $link;
	$array['user_id'] 		= $user -> id();
	$array['created'] 		= date('Y-m-d H:i:s',time());
	$dbs -> insert( DB_PRE.'index_commend' ,$array , 'id' );
	
	exit('{"status":"ok","msg":""}');
?>